package iterator;import java.util.ArrayList;/** * Created by Administrator on 2018-10-29. */public class PancakeHouseIterator implements Iterator{     ArrayList menuItems;     int position;     public PancakeHouseIterator(ArrayList menuItems){         this.menuItems= menuItems;     }    public boolean hasNext() {        if(position >=menuItems.size() || menuItems.get(position)==null){            return false;        }else{            return true;        }    }    public Object next() {        MenuItem menuItem = (MenuItem)menuItems.get(position);        position = position +1;        return menuItem;    }}